/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "horario")
@NamedQueries({
    @NamedQuery(name = "Horario.findAll", query = "SELECT h FROM Horario h"),
    @NamedQuery(name = "Horario.findByNHorId", query = "SELECT h FROM Horario h WHERE h.nHorId = :nHorId"),
    @NamedQuery(name = "Horario.findByNFncAptitud", query = "SELECT h FROM Horario h WHERE h.nFncAptitud = :nFncAptitud"),
    @NamedQuery(name = "Horario.findByNCntIteracion", query = "SELECT h FROM Horario h WHERE h.nCntIteracion = :nCntIteracion"),
    @NamedQuery(name = "Horario.findByNTmnPoblacion", query = "SELECT h FROM Horario h WHERE h.nTmnPoblacion = :nTmnPoblacion"),
    @NamedQuery(name = "Horario.findByNPrbCruce", query = "SELECT h FROM Horario h WHERE h.nPrbCruce = :nPrbCruce"),
    @NamedQuery(name = "Horario.findByNPrbMutacion", query = "SELECT h FROM Horario h WHERE h.nPrbMutacion = :nPrbMutacion"),
    @NamedQuery(name = "Horario.findByNMaxHorCnsDia", query = "SELECT h FROM Horario h WHERE h.nMaxHorCnsDia = :nMaxHorCnsDia"),
    @NamedQuery(name = "Horario.findByNMaxHorClsDia", query = "SELECT h FROM Horario h WHERE h.nMaxHorClsDia = :nMaxHorClsDia"),
    @NamedQuery(name = "Horario.findByVEstado", query = "SELECT h FROM Horario h WHERE h.vEstado = :vEstado"),
    @NamedQuery(name = "Horario.buscarMaxId", query = "SELECT MAX(h.nHorId) FROM Horario h")})
public class Horario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "nHorId")
    private Integer nHorId;
    @Column(name = "nFncAptitud")
    private Integer nFncAptitud;
    @Column(name = "nCntIteracion")
    private Integer nCntIteracion;
    @Column(name = "nTmnPoblacion")
    private Integer nTmnPoblacion;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "nPrbCruce")
    private BigDecimal nPrbCruce;
    @Column(name = "nPrbMutacion")
    private BigDecimal nPrbMutacion;
    @Column(name = "nMaxHorCnsDia")
    private Integer nMaxHorCnsDia;
    @Column(name = "nMaxHorClsDia")
    private Integer nMaxHorClsDia;
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nHorId")
    private List<Periodoxsalon> periodoxsalonList;
    @JoinColumn(name = "nCicId", referencedColumnName = "nCicId")
    @ManyToOne(optional = false)
    private Ciclo nCicId;
    
    
    public Horario() {
    }

    public Horario(Integer nHorId) {
        this.nHorId = nHorId;
    }

    public Integer getNHorId() {
        return nHorId;
    }

    public void setNHorId(Integer nHorId) {
        this.nHorId = nHorId;
    }

    public Integer getNFncAptitud() {
        return nFncAptitud;
    }

    public void setNFncAptitud(Integer nFncAptitud) {
        this.nFncAptitud = nFncAptitud;
    }
    
    public Integer getNCntIteracion() {
        return nCntIteracion;
    }

    public void setNCntIteracion(Integer nCntIteracion) {
        this.nCntIteracion = nCntIteracion;
    }

    public Integer getNTmnPoblacion() {
        return nTmnPoblacion;
    }

    public void setNTmnPoblacion(Integer nTmnPoblacion) {
        this.nTmnPoblacion = nTmnPoblacion;
    }

    public BigDecimal getNPrbCruce() {
        return nPrbCruce;
    }

    public void setNPrbCruce(BigDecimal nPrbCruce) {
        this.nPrbCruce = nPrbCruce;
    }

    public BigDecimal getNPrbMutacion() {
        return nPrbMutacion;
    }

    public void setNPrbMutacion(BigDecimal nPrbMutacion) {
        this.nPrbMutacion = nPrbMutacion;
    }

    public Integer getNMaxHorCnsDia() {
        return nMaxHorCnsDia;
    }

    public void setNMaxHorCnsDia(Integer nMaxHorCnsDia) {
        this.nMaxHorCnsDia = nMaxHorCnsDia;
    }

    public Integer getNMaxHorClsDia() {
        return nMaxHorClsDia;
    }

    public void setNMaxHorClsDia(Integer nMaxHorClsDia) {
        this.nMaxHorClsDia = nMaxHorClsDia;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Periodoxsalon> getPeriodoxsalonList() {
        return periodoxsalonList;
    }

    public void setPeriodoxsalonList(List<Periodoxsalon> periodoxsalonList) {
        this.periodoxsalonList = periodoxsalonList;
    }

    public Ciclo getNCicId() {
        return nCicId;
    }

    public void setNCicId(Ciclo nCicId) {
        this.nCicId = nCicId;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nHorId != null ? nHorId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Horario)) {
            return false;
        }
        Horario other = (Horario) object;
        if ((this.nHorId == null && other.nHorId != null) || (this.nHorId != null && !this.nHorId.equals(other.nHorId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Horario[ nHorId=" + nHorId + " ]";
    }
    
}
